
//
//  DefineHeader.h
//  delongzhitou
//
//  Created by Mr.Wang on 2018/11/22.
//  Copyright © 2018 delongzhitou. All rights reserved.
//

#ifndef DefineHeader_h
#define DefineHeader_h

//#define iPhoneX (([UIScreen mainScreen].bounds.size.height == 812) ? YES : NO)

#define kHeightTabBar                 49
#define kHeightNavigationStatusBar    (iPhoneX ? 44 : 20)
#define kHeightNavigation             (iPhoneX ? 88 : 64)
#define iPhoneXBottomUnSafeAreaHeight (iPhoneX ? 34 : 0)
#define kNavigationHeight (self.navigationController.navigationBar.frame.size.height)

#define kScreenWidth          [UIScreen mainScreen].bounds.size.width
#define kScreenHeight         [UIScreen mainScreen].bounds.size.height
#define kScreenSafeAreaHeight (kScreenHeight - iPhoneXBottomUnSafeAreaHeight)


#define kAutoWidth(width)      (width * (kScreenWidth / 375.0))
#define kAutoHeight(height)    (height * (kScreenHeight / 666.667))


#define kSystemFont(font) [UIFont systemFontOfSize:font]
#define kBoldFont(font) [UIFont boldSystemFontOfSize:font]
#define kFormatString(formatStr) [NSString stringWithFormat:@"%@", formatStr]

#define kWeakSelf __weak typeof(self) weakSelf = self;

#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif

#define kSafeString(string) (![string isKindOfClass:[NSString class]]) || \
([string isKindOfClass:[NSNull class]]) || \
([string containsString:@"null"]) || \
(!string) || \
(0 == ((NSString *)string).length)    \
? @"" : string

#define kColorHex(str)      [UIColor colorWithHex:str]
#define kColorRGB(r,g,b)    [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define kColorRGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define kColorRandom [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:0.7]

#define kuserManager [DLUserManager currentUser]
//(60, 163, 242)
//(30, 145, 250)
#define kDLBtnNormalBgColor  kColorRGB(60, 163, 242)
#define kDLViewNormalBgColor  kColorRGB(231, 231, 231)
#define kDLNormalBlackColor  kColorRGB(51, 51, 51)
#define kDLNormalGrayColor kColorRGB(153, 153, 153)


/**
 机器人-table和cell 以及cell 大背景的背景色
 */
//#define kDLMachineTableAndCellBgColor  kColorRGB(250, 250, 250)
#define kDLMachineTableAndCellBgColor  kColorRGB(235, 235, 235)
//#define kDLMachineTableAndCellBgColor  kColorRandom


/**
 机器人-表格-相关控件高度定义
 */
#define kMachineFormBgViewDefaultHeight 320 + 40
#define kMachineFormTCBgViewLeftMargin 15
#define kMachineFormTitleLabelHeight 40
#define kMachineFormTableViewHeight 180
#define kMachineFormTableViewRowHeight 40
#define kMachineFormContentTitleLabelWidth 100
#define kMachineFormBottomBtnHeight 30
#define kMachineFormControlEdgeInset 8


/**
 机器人-资讯-相关控件高度定义
 */
#define kMachineInfoViewDefaultHeight 300
#define kMachineInfoTitleLabelHeight 58
#define kMachineInfoBgViewTopMargin 12
#define kMachineInfoBgViewLeftMargin 15
#define kMachineInfoBottomBtnHeight 30

/**
 机器人-图表-相关控件高度定义
 */
#define kMachineChartsHeight 300

#define kMachineChartsBgViewLeftMargin 15

#define kMachineChartsChartLeftMargin 15


/**
 机器人-普通文字 自己消息 字体 字号
 */
#define kMachineNormalTCTextFontSelf kSystemFont(14)

/**
 机器人-普通文字 对方消息 字体 字号
 */
#define kMachineNormalTCTextFontOther kBoldFont(14)

/**
 机器人-普通文字 左边距
 */
#define kMachineNormalTCTextBgViewLeftMargin 15

/**
 机器人-普通文字 一行文字label高度
 */
#define kMachineNormalTCLabelHeight 38

/**
 机器人-普通文字 左右边距
 */
#define kMachineNormalTCLabelEdgeInsetLeftRight 15

/**
 机器人-普通文字 上下边距 以及cell之间的间距
 */
#define kMachineNormalTCLabelEdgeInsetTopBottom 13

/**
 机器人-普通文字 最大宽度
 */
#define kMachineNormalTCLabelMaxWidth kAutoWidth(252)


/**
 机器人-图片相关控件高度定义
 */
#define kMachineImageViewDefaultHeight kAutoWidth(203)

/**
 机器人-视频相关控件高度定义
 */
#define kMachineVideoViewDefaultHeight kAutoWidth(240)

#define kMachineVideoViewLeftMargin 15


/**
 机器人-单选 背景距屏幕左边距
 */
#define kMachineSingleSelectBgViewLeftMargin 15

/**
 机器人-单选 文字距背景左边距
 */
#define kMachineSingleSelectControlEdgeInset 15


#endif
